'''Project Euler Problem 48

The series, 1^(1) + 2^(2) + 3^(3) + ... + 10^(10) = 10405071317.

Find the last ten digits of the series, 1^1 + 2^2 + 3^3 + ... + 1000^1000.
'''
import time
print 'Starting...'
begin = time.clock()

maxpow = 1000
sum = 0

for i in xrange(1,maxpow+1):
    sum += i**i

print ' ...took %.3f ms.' % ((time.clock() - begin)*1000)
print 'The answer to Problem 48 is >>> %s <<<' % str(sum)[-10:]